package com.cl.ks.entity;

import com.cl.ks.DTO.Progress;
import com.cl.ks.annotation.GenerateMVC;
import com.cl.schedule.entity.ScheduleEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.*;

@Getter
@Setter
@Entity
@Table(name = "ks_flow_task")
@org.hibernate.annotations.Table(appliesTo = "ks_flow_task", comment = "流程图定时任务配置表")
@GenerateMVC
public class KsFlowTask extends ScheduleEntity {
    @ApiModelProperty("流程图id")
    private Integer ksFlowGraphId;
    @Transient
    private Boolean taskFlag = true;
    @Transient
    private Progress progress;

    @ApiModelProperty("记录列表")
    @OneToMany(mappedBy = "ksFlowTask",cascade = CascadeType.REMOVE)
//    @JoinColumn(name = "ks_flow_task_id",referencedColumnName = "id",insertable = false,updatable = false)
//    @JsonIgnoreProperties({"ksFlowGraph","ksFlowTask", "ksFlowGraphLogList", "ksFlowResultList"})
    @JsonIgnore
    @OrderBy("id desc")
    private List<KsFlowGraphRecord> ksFlowGraphRecordList;
}
